package com.dc.dao;

import com.dc.entity.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface MaterialMachineDao extends JpaRepository<MaterialMachineEntity, Long>, JpaSpecificationExecutor<MaterialMachineEntity> {
    Page<MaterialMachineEntity> findByShipRepairEntity(ShipRepairEntity shipRepair, Pageable pageable);

    Page<MaterialMachineEntity> findByShipRepairEntityAndDepartment(ShipRepairEntity shipRepair, DepartmentEntity department, Pageable pageable);

    List<MaterialMachineEntity> findByShipRepairEntityAndDepartment(ShipRepairEntity shipRepair, DepartmentEntity department);
}
